package com.huawei.hwCloudJs.core.a;

import android.util.Log;
import com.huawei.hwCloudJs.core.JSRequest;
import com.huawei.hwCloudJs.core.JsCallback;
import java.lang.reflect.Method;

public final class a {
    private Method a;
    private Class<?> b = null;

    public a(Method method) {
        this.a = method;
        Class[] parameterTypes = method.getParameterTypes();
        if (parameterTypes.length > 0 && JsCallback.class != parameterTypes[0]) {
            this.b = parameterTypes[0];
        }
    }

    public Class<?> a() {
        return this.b;
    }

    public void a(Object obj, JsCallback jsCallback) {
        try {
            ((JSRequest) this.a.getDeclaringClass().newInstance()).execute(this.a, obj, jsCallback);
        } catch (IllegalAccessException e) {
            Log.e("CallObject", "call IllegalAccessException");
        } catch (InstantiationException e2) {
            Log.e("CallObject", "call InstantiationException");
        }
    }

    public Method b() {
        return this.a;
    }
}
